<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Class: Origami::XRef::Subsection</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Class</strong></td>
          <td class="class-name-in-header">Origami::XRef::Subsection</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../../../files/origami/xreftable_rb.html">
                origami/xreftable.rb
                </a>
        <br />
            </td>
        </tr>

        <tr class="top-aligned-row">
            <td><strong>Parent:</strong></td>
            <td>
                Object
            </td>
        </tr>
        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">

    <div id="description">
      <p>
Class representing a cross-reference subsection. A subsection contains a
continute set of <a href="../XRef.html">XRef</a>.
</p>

    </div>


   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000438">[]</a>&nbsp;&nbsp;
      <a href="#M000439">each</a>&nbsp;&nbsp;
      <a href="#M000437">has_object?</a>&nbsp;&nbsp;
      <a href="#M000436">new</a>&nbsp;&nbsp;
      <a href="#M000440">to_s</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->

    <div id="section">





    <div id="attribute-list">
      <h3 class="section-bar">Attributes</h3>

      <div class="name-list">
        <table>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">range</td>
          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        </table>
      </div>
    </div>
      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Class methods</h3>

      <div id="method-M000436" class="method-detail">
        <a name="M000436"></a>

        <div class="method-heading">
          <a href="#M000436" class="method-signature">
          <span class="method-name">new</span><span class="method-args">(start, entries = [])</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Creates a <a href="Subsection.html#M000436">new</a> <a
href="../XRef.html">XRef</a> subsection.
</p>
<table>
<tr><td valign="top"><em>start</em>:</td><td>The number of the first object referenced in the subsection.

</td></tr>
<tr><td valign="top"><em>entries</em>:</td><td>An array of <a href="../XRef.html">XRef</a>.

</td></tr>
</table>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000436-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000436-source">
<pre>
     <span class="ruby-comment cmt"># File origami/xreftable.rb, line 141</span>
141:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">start</span>, <span class="ruby-identifier">entries</span> = [])
142:         
143:         <span class="ruby-ivar">@entries</span> = <span class="ruby-identifier">entries</span>.<span class="ruby-identifier">dup</span>
144:         <span class="ruby-ivar">@range</span> = <span class="ruby-constant">Range</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">start</span>, <span class="ruby-identifier">start</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">entries</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>)
145:         
146:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M000438" class="method-detail">
        <a name="M000438"></a>

        <div class="method-heading">
          <a href="#M000438" class="method-signature">
          <span class="method-name">[]</span><span class="method-args">(no)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns <a href="../XRef.html">XRef</a> associated with a given object.
</p>
<table>
<tr><td valign="top"><em>no</em>:</td><td>The <a href="../Object.html">Object</a> number.

</td></tr>
</table>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000438-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000438-source">
<pre>
     <span class="ruby-comment cmt"># File origami/xreftable.rb, line 177</span>
177:       <span class="ruby-keyword kw">def</span> <span class="ruby-operator">[]</span>(<span class="ruby-identifier">no</span>)
178:         <span class="ruby-ivar">@entries</span>[<span class="ruby-identifier">no</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@range</span>.<span class="ruby-identifier">begin</span>]
179:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000439" class="method-detail">
        <a name="M000439"></a>

        <div class="method-heading">
          <a href="#M000439" class="method-signature">
          <span class="method-name">each</span><span class="method-args">(&amp;b)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Processes <a href="Subsection.html#M000439">each</a> <a
href="../XRef.html">XRef</a> in the subsection.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000439-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000439-source">
<pre>
     <span class="ruby-comment cmt"># File origami/xreftable.rb, line 184</span>
184:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">each</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">b</span>)
185:         <span class="ruby-ivar">@entries</span>.<span class="ruby-identifier">each</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">b</span>)
186:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000437" class="method-detail">
        <a name="M000437"></a>

        <div class="method-heading">
          <a href="#M000437" class="method-signature">
          <span class="method-name">has_object?</span><span class="method-args">(no)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns whether this subsection contains information about a particular
object.
</p>
<table>
<tr><td valign="top"><em>no</em>:</td><td>The <a href="../Object.html">Object</a> number.

</td></tr>
</table>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000437-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000437-source">
<pre>
     <span class="ruby-comment cmt"># File origami/xreftable.rb, line 169</span>
169:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">has_object?</span>(<span class="ruby-identifier">no</span>)
170:         <span class="ruby-ivar">@range</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">no</span>)
171:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000440" class="method-detail">
        <a name="M000440"></a>

        <div class="method-heading">
          <a href="#M000440" class="method-signature">
          <span class="method-name">to_s</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Outputs self into <a href="../PDF.html">PDF</a> code.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000440-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000440-source">
<pre>
     <span class="ruby-comment cmt"># File origami/xreftable.rb, line 191</span>
191:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s</span>
192:         <span class="ruby-identifier">section</span> = <span class="ruby-node">&quot;#{@range.begin} #{@range.end - @range.begin + 1}&quot;</span> <span class="ruby-operator">+</span> <span class="ruby-constant">EOL</span>
193:         <span class="ruby-ivar">@entries</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">xref</span><span class="ruby-operator">|</span>
194:           <span class="ruby-identifier">section</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">xref</span>.<span class="ruby-identifier">to_s</span>
195:         }
196:         
197:         <span class="ruby-identifier">section</span>
198:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>